/*
 * Copyright 2011 The Rusted Roof, LLC.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package org.proteusframework.core.api;

import org.proteusframework.core.api.model.IGlyphRenderer;

/**
 * Runtime engine implementations are responsible for combining platform-specific runtime configuration definitions
 * and an actual runtime environment to deliver the actual scope of the application.
 *
 * @author Tacoma Four
 */
public interface IRuntimeEngine extends Runnable, IDelegateConsumer
{
    /**
     * Access the runtime configuration that defines the execution strategy for the engine.
     *
     * @return Runtime configuration
     */
    IRuntimeConfiguration getRuntimeConfiguration();

    /**
     * Identify the runtime environment.
     *
     * @return Runtime environment
     */
    RuntimeEnvironment getRuntimeEnvironment();

    /**
     * Access the runtime engine's glyph renderer. Glyph renderers provide platform abstraction; Java SE typically
     * uses a <code>BufferedImage</code>, while the Android SDK uses <code>Bitmap</code>.
     *
     * @return Glyph renderer
     */
    IGlyphRenderer getGlyphRenderer();

    /**
     * Flag that indicates if the engine is presently running or now.
     *
     * @return true, if the engine is running
     */
    boolean isRunning();

    /**
     * Trigger that indicates that the engine must release all of its resources and fully shutdown.
     */
    void stop();
}
